package com.avfh.netcard.common;

import java.io.Serializable;

public class Result<T> implements Serializable {

    public static final Result NULL_RESULT = new Result("暂无数据", "1003");

    private String code = "1001";
    private T data;
    private String msg = "成功";

    public Result() {

    }

    public Result(T data) {
        this.data = data;
    }

    public Result(String msg, String code) {
        this.msg = msg;
        this.code = code;
    }

    public Result(String msg, String code, T data) {
        this.msg = msg;
        this.code = code;
        this.data = data;
    }

    public String getCode() {
        return code;
    }

    public Result setCode(String code) {
        this.code = code;
        return this;
    }

    public T getData() {
        return data;
    }

    public Result setData(T data) {
        this.data = data;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public Result setMsg(String msg) {
        this.msg = msg;
        return this;
    }

}
